package com.byb.server.service.mapper;

import com.byb.server.domain.*;
import com.byb.server.service.dto.ClaimScoringDTO;

import org.mapstruct.*;

/**
 * Mapper for the entity ClaimScoring and its DTO ClaimScoringDTO.
 */
@Mapper(componentModel = "spring", uses = {ProductMapper.class, })
public interface ClaimScoringMapper extends EntityMapper <ClaimScoringDTO, ClaimScoring> {

    @Mapping(source = "product.id", target = "productId")
    ClaimScoringDTO toDto(ClaimScoring claimScoring); 

    @Mapping(source = "productId", target = "product")
    ClaimScoring toEntity(ClaimScoringDTO claimScoringDTO); 
    default ClaimScoring fromId(Long id) {
        if (id == null) {
            return null;
        }
        ClaimScoring claimScoring = new ClaimScoring();
        claimScoring.setId(id);
        return claimScoring;
    }
}
